package com.chenyue.cm.news.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 新闻
 * </p>
 *
 * @author ljy
 * @since 2021-08-18
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value = "JdNews对象", description = "新闻")
public class JdNews extends Model<JdNews> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "新闻标题")
    private String title;

    @ApiModelProperty(value = "新闻内容")
    private String content;

    @ApiModelProperty(value = "发布人")
    private Integer cu;

    @ApiModelProperty(value = "发布时间")
    @TableField(fill = FieldFill.INSERT)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date ct;

    @ApiModelProperty(value = "是否展示 0隐藏1展示")
    private Integer isShow;

    @ApiModelProperty(value = "封面图")
    private String cover;

    @ApiModelProperty(value = "展示方式")
    private Integer showType;

    @ApiModelProperty(value = "是否推荐0不推荐1推荐")
    private Integer isRecommend;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
